package com.example.administrator.lifetest;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.ButtonBarLayout;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
    private Button bt;
static  final String LIFT_TAG="LogActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Log.v(LIFT_TAG,"First Activity --->onCreate");
        Button  bt = (Button) findViewById(R.id.button);
        bt.setOnClickListener(new ButtonOnClickListener());

    }

    @Override
    protected void onPostResume() {
        super.onPostResume();
        Log.v(LIFT_TAG,"FirstActivity --->onResume");
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.v(LIFT_TAG,"FirstActivity --->onStart");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.v(LIFT_TAG,"FirstActivity --->onRestart");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.v(LIFT_TAG,"FirstActivity --->onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.v(LIFT_TAG,"FirstActivity --->onDestory");
    }

    protected void onPause(){
        super.onPause();
        Log.v(LIFT_TAG,"FirstActivity --->onPause");
    }
    class ButtonOnClickListener implements View.OnClickListener{
        @Override
        public void onClick(View view) {
        Intent intent = new Intent();
        intent.setClass(MainActivity.this, SecondActivity.class);
        MainActivity.this.startActivity(intent);
    }


    }
}